package com.shaobufan.museum.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalTime;

/**
 * 时刻表
 * @TableName moment
 */
@TableName(value ="moment")
@Data
public class Moment implements Serializable {
    /**
     * id
     */
    @TableId(value = "mo_id", type = IdType.AUTO)
    private Integer moId;

    /**
     * 时刻
     */
    @TableField(value = "moment")
    private LocalTime moment;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Moment other = (Moment) that;
        return (this.getMoId() == null ? other.getMoId() == null : this.getMoId().equals(other.getMoId()))
            && (this.getMoment() == null ? other.getMoment() == null : this.getMoment().equals(other.getMoment()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMoId() == null) ? 0 : getMoId().hashCode());
        result = prime * result + ((getMoment() == null) ? 0 : getMoment().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", moId=").append(moId);
        sb.append(", moment=").append(moment);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}